home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 1.3 KB | 52 lines | [TEXT/CWIE] |
- // FontSize.h
-
- #ifndef FontSize_h
- #define FontSize_h
-
- #ifndef Integers_h
- #include "Integers.h"
- #endif
- #ifndef Assert_h
- #include "Assert.h"
- #endif
-
- class FontSize
- {
- private:
- uint16 size;
-
- FontSize( uint16 value )
- : size( value )
- {}
-
- public:
- uint16 Value() const { return size; }
-
- static FontSize Make( uint16 );
- static FontSize Default();
-
- static FontSize Smallest() { return 1; }
- static FontSize Largest() { return maxint16; }
-
- FontSize operator++() { Assert( size < maxint16 ); return ++size; }
- FontSize operator++(int) { Assert( size < maxint16 ); return size++; }
-
- FontSize operator--() { Assert( size > 1 ); return --size; }
- FontSize operator--(int) { Assert( size > 1 ); return size--; }
-
- void operator+=( int16 d );
- void operator-=( int16 d );
-
- FontSize operator+( int16 d ) const;
- FontSize operator-( int16 d ) const;
-
- bool operator==( FontSize f ) const { return size == f.size; }
- bool operator!=( FontSize f ) const { return size != f.size; }
- bool operator>=( FontSize f ) const { return size >= f.size; }
- bool operator<=( FontSize f ) const { return size <= f.size; }
- bool operator>( FontSize f ) const { return size > f.size; }
- bool operator<( FontSize f ) const { return size < f.size; }
- };
-
- #endif
-